import java.util.*;

/**
 * @Author: Lenovo
 * @Date: 2024/7/28 21:50
 * @description:
 */
public class Test {
    public static void main(String[] args) {
        
    }
    public static void main1(String[] args) {
        Map<String ,Integer> map = new TreeMap<>();
        map.put("hello",4);
        map.put("world",20);
        map.put("Tom",5);
        // 获得每个key所对应的value
        Set<Map.Entry<String,Integer>> set =map.entrySet();
        for(Map.Entry<String,Integer>entry:set){
            System.out.println(entry.getKey()+" "+entry.getValue());
        }
        //修改"Tom"的值，对应值加1
        int val = map.get("Tom");
        map.put("Tom",val+1);

        map.getOrDefault("Jerry",20);
        System.out.println(map.containsKey("Tom"));
        System.out.println(map.containsValue(10));
    }
}
